<%@ page import="com.sunelec.pojo.Users" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!doctype html>
<html lang="en">
<head>
    <title>历史数据表</title>
    <meta name="renderer" content="webkit" />
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link href="${pageContext.request.contextPath}/static/css/font-awesome.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/static/css/bootstrap.min.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/static/css/style.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/static/css/history.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/static/css/page.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/static/laydate/theme/default/laydate.css" rel="stylesheet" />
    <script src="${pageContext.request.contextPath}/static/js/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/tablleColor.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath}/static/laydate/laydate.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/historyTableAjax.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/historyTablePage1.js"></script>
    <script src="${pageContext.request.contextPath}/static/js/historyTablePage2.js"></script>
    <script>
        data = ${result};
    </script>
</head>
<body>
<div class="top">
    <div class="top-left">
        <div class="kong"></div>
        <div class="logo">
            <img src="${pageContext.request.contextPath}/static/imgs/logo3.png">
        </div>
    </div>
    <div class="top-right">
        <ul class="list">
            <li><a href="${pageContext.request.contextPath}/powerCenter.action?username=${username}">电站中心</a></li>
            <li><a href="checkCenter.jsp">运维中心</a></li>
            <li><a href="${pageContext.request.contextPath}/InReportCenter">报表中心</a></li>
            <li><a href="${pageContext.request.contextPath}/centralizedControl">展示中心</a></li>
            <% if(session.getAttribute("users")!=null){
                Users users = (Users)session.getAttribute("users");
            %>
            <% if(users.getType()==1){%>
            <li><a href="${pageContext.request.contextPath}/InidManage">账号管理</a></li>
            <% }%>
            <% } %>
            <li><a href="${pageContext.request.contextPath}/checkOut.action" ><span class="fa fa-user"></span></a></li>
        </ul>
    </div>
</div>
<div class="main">
    <div class="left">
        <div id="side" class="side">
            <form id="myForm" action="">
                <div class="box">
                    <input type="text" placeholder="选择具体日期" id="test1" class="text-center" name="date1">
                </div>
                <div class="box">
                    <input type="text" placeholder="选择时间段" id="test2" class="text-center" name="date2">
                </div>
                <div class="box">
                    <select name="idTest">
                        <c:forEach items="${powers}" var="p">
                            <c:if test="${selected.equals(p.powerId)}">
                                <option value="${p.powerId}" selected="selected">${p.powerName}</option>
                            </c:if>

                            <c:if test="${!selected.equals(p.powerId)}">
                                <option value="${p.powerId}">${p.powerName}</option>
                            </c:if>
                        </c:forEach>
                    </select>
                </div>
                <div class="box">
                    <div class="dropdown">
                        <button  class="btn btn-default" data-toggle="dropdown">
                            <span id="select">采集器</span>
                            <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu dropdown-menu-left" id="tab" style="background: white!important;">
                            <li><a href="#" onclick="caiji()">采集器</a></li>
                            <li><a href="#" onclick="libian()">逆变器</a></li>
                            <li><a href="#" onclick="dianbiao()">电表</a></li>
                            <li><a href="#" onclick="qixiang()">气象站</a></li>
                        </ul>
                    </div>
                </div>
                <div class="box">
                    <input type="button" value="导出表格" onclick="beforeSubmit('ExcelOut_Example5')">
                </div>
                <div class="box">
                    <input type="button" value="搜 索" class="text-center" onclick="beforeSubmit('InHistoryTable')" >
                </div>
                <div class="box kong2">

                </div>
            </form>
        </div>
    </div>
    <div class="center">
        <div class="block" >
            <div class="con">
                <table class="table table-bordered table-striped one" id="dataTable1">
                </table>
                <div id="ui-page1" class="ui-page">

                </div>
            </div>
            <div class="con" style="display: none">
                <table class="table table-bordered table-striped two" id="dataTable2" >

                </table>
                <div id="ui-page2" class="ui-page2">

                </div>
            </div>
            <div class="con" style="display: none">
                <table class="table table-striped table-bordered three" id="dataTable3" >
                    <tr class="title">
                        <td class="text-center">电表序列号</td>
                        <td class="text-center">倍率</td>
                        <td class="text-center">电压(V)</td>
                        <td class="text-center">电流(I)</td>
                        <td class="text-center">有功功率(W)</td>
                        <td class="text-center">无功功率(W)</td>
                        <td class="text-center">功率因素(W)</td>
                        <td class="text-center">频率(Hz)</td>
                        <td class="text-center">正常电能(kWh)</td>
                        <td class="text-center">反向电能(kWh)</td>
                        <td class="text-center">更新时间</td>
                    </tr>
                    <tr class="even">
                        <td>aaaaaaaa</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>1.4</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>设备因素</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td><span class="time-hour">15:44</span><span class="time-date">2018/3/19</span></td>
                    </tr>
                    <tr class="odd">
                        <td>aaaaaaaa</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>1.4</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>设备因素</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td><span class="time-hour">15:44</span><span class="time-date">2018/3/19</span></td>
                    </tr>
                    <tr class="even">
                        <td>aaaaaaaa</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>1.4</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>设备因素</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td><span class="time-hour">15:44</span><span class="time-date">2018/3/19</span></td>
                    </tr>
                    <tr class="odd">
                        <td>aaaaaaaa</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>1.4</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>设备因素</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td><span class="time-hour">15:44</span><span class="time-date">2018/3/19</span></td>
                    </tr>
                    <tr class="even">
                        <td>aaaaaaaa</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>1.4</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>设备因素</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td><span class="time-hour">15:44</span><span class="time-date">2018/3/19</span></td>
                    </tr>
                    <tr class="odd">
                        <td>aaaaaaaa</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>1.4</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>设备因素</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td><span class="time-hour">15:44</span><span class="time-date">2018/3/19</span></td>
                    </tr>
                    <tr class="even">
                        <td>aaaaaaaa</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>1.4</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>设备因素</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td><span class="time-hour">15:44</span><span class="time-date">2018/3/19</span></td>
                    </tr>
                    <tr class="odd">
                        <td>aaaaaaaa</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>1.4</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>设备因素</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td><span class="time-hour">15:44</span><span class="time-date">2018/3/19</span></td>
                    </tr>
                    <tr class="even">
                        <td>aaaaaaaa</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>1.4</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>设备因素</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td>0.1</td>
                        <td><span class="time-hour">15:44</span><span class="time-date">2018/3/19</span></td>
                    </tr>
                </table>
                <div class="page">
                    <ul class="pagination text-center">
                        <li class="bg"><a href="#">前一页</a></li>
                        <li class="lg"><a href="#">&laquo;</a></li>
                        <li class="active bg1"><a href="#">1</a></li>
                        <li class="active bg"><a href="#">2</a></li>
                        <li class="active bg"><a href="#">3</a></li>
                        <li class="active bg"><a href="#">4</a></li>
                        <li class="active bg2"><a href="#">5</a></li>
                        <li class="lg"><a href="#">&raquo;</a></li>
                        <li class="bg"><a href="#">下一页</a></li>
                    </ul>
                </div>
            </div>
            <div class="con" style="display: none">
                <table class="table table-striped table-bordered four" id="dataTable4">
                    <tr class="title">
                        <td class="text-center">风速</td>
                        <td class="text-center">风向</td>
                        <td class="text-center">大气温度(℃)</td>
                        <td class="text-center">大气湿度</td>
                        <td class="text-center">组件温度(℃)</td>
                        <td class="text-center">总辐射(Gy)</td>
                    </tr>
                    <tr class="even">
                        <td>3级</td>
                        <td>西北风</td>
                        <td>20</td>
                        <td>79%</td>
                        <td>10</td>
                        <td>0.5</td>
                    </tr>
                    <tr class="odd">
                        <td>3级</td>
                        <td>西北风</td>
                        <td>20</td>
                        <td>79%</td>
                        <td>10</td>
                        <td>0.5</td>
                    </tr>
                    <tr class="even">
                        <td>3级</td>
                        <td>西北风</td>
                        <td>20</td>
                        <td>79%</td>
                        <td>10</td>
                        <td>0.5</td>
                    </tr>
                    <tr class="odd">
                        <td>3级</td>
                        <td>西北风</td>
                        <td>20</td>
                        <td>79%</td>
                        <td>10</td>
                        <td>0.5</td>
                    </tr>
                    <tr class="even">
                        <td>3级</td>
                        <td>西北风</td>
                        <td>20</td>
                        <td>79%</td>
                        <td>10</td>
                        <td>0.5</td>
                    </tr>
                    <tr class="odd">
                        <td>3级</td>
                        <td>西北风</td>
                        <td>20</td>
                        <td>79%</td>
                        <td>10</td>
                        <td>0.5</td>
                    </tr>
                    <tr class="even">
                        <td>3级</td>
                        <td>西北风</td>
                        <td>20</td>
                        <td>79%</td>
                        <td>10</td>
                        <td>0.5</td>
                    </tr>
                    <tr class="odd">
                        <td>3级</td>
                        <td>西北风</td>
                        <td>20</td>
                        <td>79%</td>
                        <td>10</td>
                        <td>0.5</td>
                    </tr>
                    <tr class="even">
                        <td>3级</td>
                        <td>西北风</td>
                        <td>20</td>
                        <td>79%</td>
                        <td>10</td>
                        <td>0.5</td>
                    </tr>
                    <tr class="odd">
                        <td>3级</td>
                        <td>西北风</td>
                        <td>20</td>
                        <td>79%</td>
                        <td>10</td>
                        <td>0.5</td>
                    </tr>
                </table>
                <div class="page">
                    <ul class="pagination text-center">
                        <li class="bg"><a href="#">前一页</a></li>
                        <li class="lg"><a href="#">&laquo;</a></li>
                        <li class="active bg1"><a href="#">1</a></li>
                        <li class="active bg"><a href="#">2</a></li>
                        <li class="active bg"><a href="#">3</a></li>
                        <li class="active bg"><a href="#">4</a></li>
                        <li class="active bg2"><a href="#">5</a></li>
                        <li class="lg"><a href="#">&raquo;</a></li>
                        <li class="bg"><a href="#">下一页</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${pageContext.request.contextPath}/static/js/historyTable.js"></script>
<script src="${pageContext.request.contextPath}/static/js/TablePage.js"></script>
<script>



    if(${pageNum2} != null)
    {
        if(${pageNum2 == 1}) {
            var initTotalPageNum2 = 2;
            $("#ui-page2").paging2({pageSize2:1,totalPage2:initTotalPageNum2});
            document.getElementsByClassName('page2')[0].click();
            document.getElementById('next2').style.display='none';
            document.getElementById('end2').style.display='none';
        } else {
            var initTotalPageNum2 = ${pageNum2};
            $("#ui-page2").paging({pageSize2:3,totalPage2:initTotalPageNum});
            document.getElementsByClassName('page2')[0].click();
        }
    }

    if(${pageNum1} != null)
    {
        if(${pageNum1 == 1}) {
            var initTotalPageNum = 2;
            $("#ui-page1").paging1({pageSize:1,totalPage:initTotalPageNum});
            document.getElementsByClassName('page')[0].click();
            document.getElementById('next').style.display='none';
            document.getElementById('end').style.display='none';
        } else {
            var initTotalPageNum = ${pageNum1};
            $("#ui-page1").paging1({pageSize:3,totalPage:initTotalPageNum});
            document.getElementsByClassName('page')[0].click();
        }
    }
</script>
</body>
</html>
